#ifndef __CUDA_UTILS_H__
#define __CUDA_UTILS_H__

#include <stdio.h>
#include "cuda.h"
#include "cuda_runtime.h"
#include "device_launch_parameters.h"

static void handle_cuda_error( cudaError_t err, const char *file, int line )
{
    if ( err != cudaSuccess )
	{
        printf( "%s in %s at line %d\n", cudaGetErrorString( err ), file, line );
        exit( EXIT_FAILURE );
    }
}

#define HANDLE_CUDA_ERROR( err ) ( handle_cuda_error( err, __FILE__, __LINE__ ) )

#endif /* __CUDA_UTILS_H__ */
